package leetcode_day._2021._202105._2131;

/**
 * @author yzh
 * @version 1.0
 * @date 2021/5/31 22:24
 * 4 的幂
 * 算法：位运算  数学
 */
public class _31_342 {

    public boolean isPowerOfFour(int n) {
        if (n < 0) return false;
        int s = (int) Math.sqrt(n);
        return s * s == n && (s & (s - 1)) == 0;
    }

}
